package OrderService

import (
	"context"
	"gdshop-font-api-go/app/request/OrderReq"
	"gdshop-font-api-go/library/response"
	"github.com/gogf/gf/frame/g"
)

func CheckSubmitOk(ctx context.Context, parames *OrderReq.CheckSubmitOk) *response.JsonResponse {
	doVar, err := g.Redis().Ctx(ctx).DoVar("GET", "CheckSubmitOk:"+parames.MessageId)
	if err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	if doVar.IsEmpty() {
		return response.JsonByAll(nil, 2, "reload")
	}

	var jieguo response.JsonResponse
	err = doVar.Scan(&jieguo)
	if err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return &jieguo
}
